import { FC } from "react";
import { View, Image } from "@tarojs/components";
import styles from "./index.module.less";
import { HIcon } from "@/components";

interface IProps {
  /** 是否有权限联系 */
  isPermissionContact: boolean;
  /** 点击射箭 */
  onArchery: () => void;
  /** 点击联系 */
  onConnect: () => void;
}

const SliderBar: FC<IProps> = ({
  isPermissionContact,
  onArchery,
  onConnect,
}) => {
  return (
    <View className={styles["sliderbar-wrapper"]}>
      {isPermissionContact ? (
        <View className={styles["lianxi-wrapper"]} onClick={onConnect}>
          <HIcon type="lianxi" size={62} color="#FD486E"></HIcon>
        </View>
      ) : (
        <View className={styles["shejian-wrapper"]}>
          <Image
            className={styles["shejian"]}
            src={require("@/assets/img/shejian.png")}
            onClick={onArchery}
          />
        </View>
      )}
    </View>
  );
};

export default SliderBar;
